package cz.cuni.mff.ufal.volk.services;

import cz.cuni.mff.ufal.volk.Listener;
import cz.cuni.mff.ufal.volk.Text;

public class LanguageRecognizerInputProcessor implements Listener<String> {

	public LanguageRecognizerInputProcessor(LanguageRecognizer<Text> underlying, String keyword) {
		this.underlying = underlying;
		this.keyword = keyword;
	}

	private final LanguageRecognizer<Text> underlying;
	private final String keyword;

	@Override
  public void process(String event) {
		if (event.startsWith(keyword))
			System.out.println(underlying.recognize(new Text(null, event.substring(keyword.length()))));
  }

}
